﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Silverlight.ControlToolkit.Windows;

namespace Test.Silverlight.ControlToolkit
{
    public partial class ConventionalValidation : UserControl
    {
        public ConventionalValidation()
        {
            InitializeComponent();
        }

        private void btnValidateAll_Click(object sender, RoutedEventArgs e)
        {
            if (txtRequired.Text.Length == 0)
            {
                MessageWindow.Show("Required field cannot be blank ");
                return;
            }

            if (txtAmount.Text.Length > 0 && Convert.ToDouble(txtAmount.Text) > 500 )
            {
                MessageWindow.Show("Amount cannot be greater than 500 ");
                return;
            }

            if (! txtCustom.Text.Equals("ocdotnet"))
            {
                MessageWindow.Show("Input in Custom is invalid " );
                return;
            }

            MessageWindow.Show("Record saved successfully ");

        }
    }
}
